import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router";
import UserLoginPage from "@/pages/user/userLoginPage.vue";
import userregisterPage from "@/pages/user/userregisterPage.vue";
import videoPage from "@/pages/user/videoPage.vue";
import checkPage from "@/pages/user/checkPage.vue";
import ChartsLayoutsPage from "@/pages/user/ChartsLayoutsPage.vue";
import guangdongPage from "@/views/GuangdongPage.vue";

const routes: Array<RouteRecordRaw> = [
  {
    path: "/user/page",
    name: "home",
    component: ChartsLayoutsPage,
  },
  {
    path: "/user/login",
    name: "userLogin",
    component: UserLoginPage,
  },
  {
    path: "/user/register",
    name: "userRegister",
    component: userregisterPage,
  },
  {
    path: "/admin/uservideo:videoId", // 动态路由参数
    name: "userMange",
    component: videoPage,
  },
  {
    path: "/user/table", // 动态路由参数
    name: "userTable",
    component: checkPage,
  },
  {
    path: "/user/page/guangdong", // 动态路由参数
    name: "guangdongPage",
    component: guangdongPage,
  },
];

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes,
});

export default router;
